// 主题颜色 --仅用于首页

var cssIndex = [],//获取样式表-注意排序
    cssIndex2 = [],
    isMotif = JSON.parse(window.localStorage.getItem('layuiAdmin'))?JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.main:"";//默认主题
// 获取 motif 样式表

function alterMotif() {
    for (var i = 0; i < document.styleSheets.length; i++) {
        var sheet = document.styleSheets[i];
        if (sheet.title === "motif") {
            cssIndex = sheet.cssRules;
        }
    }
    if (JSON.parse(window.localStorage.getItem('layuiAdmin'))) {

        //设置不同透明度的颜色 /10% - 100%/ 注意透明度的大小写
        var pellucidityOne = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "1a",
            pellucidityTwo = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "33",
            pellucidityThree = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "4d",
            pellucidityFour = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "66",
            pellucidityFive = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "80",
            pelluciditySix = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "99",
            pelluciditySeven = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "b3",
            pellucidityEight = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "cc",
            pellucidityNine = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "e6",
            pellucidityTen = JSON.parse(window.localStorage.getItem('layuiAdmin')).theme.color.header + "ff";
        //动态变更主体颜色

        // $(".this-home").css({"background": pellucidityTwo})//首页 首页图标
        // $(".layui-icon-prev").css("color", pellucidityTen)//首页 左箭头
        // $(".layui-icon-next").css("color", pellucidityTen)//首页 右箭头
        // $(".layui-icon-down").css("color", pellucidityTen)//首页 下箭头
        //$(".this-home").css({"background": pellucidityTen})//首页 首页图标
        $(".layui-icon-prev").css("color", "#666")//首页 左箭头
        $(".layui-icon-next").css("color", "#666")//首页 右箭头
        $(".layui-icon-down").css("color", "#666")//首页 下箭头
        if (cssIndex[0]) {
            // 修改cssIndex样式表的预设元素 /dh-motif.css
            cssIndex[0].style.setProperty(cssIndex[0].style[0], pellucidityOne)
            cssIndex[0].style.setProperty(cssIndex[0].style[1], pellucidityTwo)
            cssIndex[0].style.setProperty(cssIndex[0].style[2], pellucidityThree)
            cssIndex[0].style.setProperty(cssIndex[0].style[3], pellucidityFour)
            cssIndex[0].style.setProperty(cssIndex[0].style[4], pellucidityFive)
            cssIndex[0].style.setProperty(cssIndex[0].style[5], pelluciditySix)
            cssIndex[0].style.setProperty(cssIndex[0].style[6], pelluciditySeven)
            cssIndex[0].style.setProperty(cssIndex[0].style[7], pellucidityEight)
            cssIndex[0].style.setProperty(cssIndex[0].style[8], pellucidityNine)
            cssIndex[0].style.setProperty(cssIndex[0].style[9], pellucidityTen)
        }
    }


}
